package utils

import (
	"crypto/sha256"
	"fmt"
)

func VerifyToken(ak string, sk string, token string) bool {
	return token == generateToken(ak, sk)
}

func generateToken(ak string, sk string) string {
	hash := sha256.New()
	data := []byte(ak + ":" + sk)
	hash.Write(data)
	hashBytes := hash.Sum(nil)
	token := fmt.Sprintf("%x", hashBytes)
	fmt.Println(token)
	return token
}
